package com.zt.csp.shorturl.interceptor;

import com.zt.csp.shorturl.utils.ThreadLocalUtils;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName TempInterceptor
 * @Description
 * @Author zhangtonghy
 * @Date 2019-01-30 14:59
 * @Copyright: 版权所有 (C) zt zt.
 * @注意：本内容仅限于zt内部传阅，禁止外泄以及用于其他的商业目的
 **/
@Component
public class TempInterceptor extends HandlerInterceptorAdapter {
    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {

        ThreadLocalUtils.USER_THREAD_LOCAL.set("userId");
        return true;
    }
}
